'use strict';
/**
*service.js
*auth:lww
*version:1.0
*create date:2021-01-11
*/
var SUCCESS_CODE = "000000";
var apiBase = "<#if apiBase??>${apiBase}</#if>";
function getRequestUrl(apiPath){
    return apiBase.concat(apiPath);
}

function getCrsf(){
    return "_crsf=".concat(getURLParams("_crsf"));
}

function setCrsf(authInfo){
    if(authInfo){
        authInfo.crsfToken = getURLParams("_crsf");
    }    
    return authInfo;
}

function getAuthHeader(authInfo){   
    var authHeader = new Dictionary("authHeader");
    authHeader.addWord(new Word(0,"_crsf",authInfo.crsfToken,""));
    if(isNull(authInfo)){
        return;
    }
    authHeader.addWord(new Word(1,"_auth_token",authInfo.authToken,""));   
    return authHeader;
} 

function apiAuthInfo(refContext){
    var path = getRequestUrl("/auth/info?".concat(getCrsf()));
    return new ApiInfo(refContext, path, null, null);
}

function apiMenuInfo(refContext,authInfo){
    var path = getRequestUrl("/auth/menu.info");
    return new ApiInfo(refContext, path, null, getAuthHeader(authInfo));
}

function apiConfigAppPage(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/applicaion/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigAppList(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/applicaion/list");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigAppAdd(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/applicaion/add");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigAppCopy(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/applicaion/copy");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigAppUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/applicaion/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfiles(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfilesList(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/list");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfilesYaml(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/yaml");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfileYamlUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/yaml/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfileAdd(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/add");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfileUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfileSync(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/sync");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiConfigProfileRefresh(refContext,authInfo,data){
    var path = getRequestUrl("/api/config/property/refresh");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiMenuPage(refContext,authInfo,data){
    var path = getRequestUrl("/api/menu/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiMenuList(refContext,authInfo,data){
    var path = getRequestUrl("/api/menu/list");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiMenuTree(refContext,authInfo,data){
    var path = getRequestUrl("/api/menu/tree");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiMenuAdd(refContext,authInfo,data){
    var path = getRequestUrl("/api/menu/add");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiMenuUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/menu/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiMenuMove(refContext,authInfo,data){
    var path = getRequestUrl("/api/menu/move");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiRolePage(refContext,authInfo,data){
    var path = getRequestUrl("/api/role/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiRoleList(refContext,authInfo,data){
    var path = getRequestUrl("/api/role/list");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiRoleAdd(refContext,authInfo,data){
    var path = getRequestUrl("/api/role/add");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiRoleUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/role/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiRoleMenuPage(refContext,authInfo,data){
    var path = getRequestUrl("/api/role/menu/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiRoleMenuList(refContext,authInfo,data){
    var path = getRequestUrl("/api/role/menu/list");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiRoleMenuUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/role/menu/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiUserPage(refContext,authInfo,data){
    var path = getRequestUrl("/api/user/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiUserAdd(refContext,authInfo,data){
    var path = getRequestUrl("/api/user/add");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiUserUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/user/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiUserPwdUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/user/update/password");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiUserRolePage(refContext,authInfo,data){
    var path = getRequestUrl("/api/user/role/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiUserRoleList(refContext,authInfo,data){
    var path = getRequestUrl("/api/user/role/list");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiUserRoleUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/user/role/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiLogPage(refContext,authInfo,data){
    var path = getRequestUrl("/api/log/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiInstancePage(refContext,authInfo,data){
    var path = getRequestUrl("/api/instances/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiInstanceProxy(refContext,authInfo,data){
    var path = getRequestUrl("/api/instances/proxy");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiInstanceRefresh(refContext,authInfo,data){
    var path = getRequestUrl("/api/instances/refresh");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiJobPage(refContext,authInfo,data){
    var path = getRequestUrl("/api/job/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiJobAdd(refContext,authInfo,data){
    var path = getRequestUrl("/api/job/add");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiJobUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/job/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiJobStatusUpdate(refContext,authInfo,data){
    var path = getRequestUrl("/api/job/status/update");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiJobSchedule(refContext,authInfo,data){
    var path = getRequestUrl("/api/job/schedule");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

function apiJobLogPage(refContext,authInfo,data){
    var path = getRequestUrl("/api/job/log/page");
    return new ApiInfo(refContext, path, data, getAuthHeader(authInfo));
}

markscript("service");
//end service.js